package com.taobao.txc.a.b;

import com.alibaba.fastjson.JSON;
import com.taobao.txc.a.c.a;
import com.taobao.txc.a.c.d;
import com.taobao.txc.common.LoggerWrap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

class j
  implements d
{
  j(g paramg) {}
  
  public void a(List<String> paramList)
  {
    g.i().info("received new server list:" + JSON.toJSONString(paramList));
    if ((g.c != null) && (this.a.k.a().size() == paramList.size()) && (this.a.k.a().containsAll(paramList))) {
      return;
    }
    g.a(this.a, System.currentTimeMillis());
    this.a.k.a(paramList);
    if (paramList.size() < 3) {
      this.a.k.a(this.a.l(), paramList.size() == 0 ? null : (String)this.a.g.get(paramList.get(0)), g.k());
    }
    if (g.c != null)
    {
      Iterator localIterator1 = paramList.iterator();
      while (localIterator1.hasNext())
      {
        String str = (String)localIterator1.next();
        synchronized (g.d())
        {
          Iterator localIterator2 = g.d().iterator();
          while (localIterator2.hasNext())
          {
            o localo = (o)localIterator2.next();
            if (str.equals(localo.c()))
            {
              if (localo.b() >= localo.a()) {
                break;
              }
              localo.a(localo.a());
              g.e();
              break;
            }
          }
        }
      }
    }
    g.a(this.a);
  }
  
  public void a(String paramString1, String paramString2)
  {
    g.i().info(String.format("add new vip server mapping:%s ==> %s", new Object[] { paramString1, paramString2 }));
    g.b(this.a).put(paramString1, paramString2);
    g.c(this.a).put(paramString2, paramString1);
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.a.b.j
 * JD-Core Version:    0.7.0.1
 */